﻿          
<form id="FrmCreateComment" method="post" action="{RootUrl}/_Ajax/Blog.aspx?op=CreateComment">
    <h1 class="showHiddenForm hd">添加Comment</h1>
    <h1 class="hideHiddenForm hd" style="display:none">添加Comment()</h1>
    <div class="hiddenForm bd">
        <input type="hidden" name="BlogId" value="{BlogId}" />
        <input type="hidden" name="CategoryId" value="{CategoryId}" />
        <input type="hidden" name="ArticleId" value="{ArticleId}" />
        <ul>
            <li>
                <label>Title:</label><input type="text" name="Title" />
            </li>
            <li>
                <label>Content:</label><textarea name="Content"></textarea>
            </li>
            <li>
                <label>Author:</label><input type="text" name="Author" />
            </li>
            <li>
                <label>&nbsp;</label><button>提交</button>
            </li>
        </ul>
    </div>
</form>
          
<script type="text/javascript">

$(function(){

    // 绑定添加事件
    $("#FrmCreateComment").ajaxSubmit( function(dat){
        $('body').alert(dat.response||dat.error||"");
        if(dat.response){
            $("#FrmDeleteComments").load("subpages/CommentList.aspx{Request.Url.Query}");
        }
    });
    
    // 绑定显示隐藏表单
    var showHandlers = $('.showHiddenForm');
    var panels = $('.hiddenForm');
    
    // 单个预览
    showHandlers.each(function(i){
        $(showHandlers[i]).click(function(){
            $(panels[i]).slideToggle('normal',function(){});
        });
    });
});

</script>
